import java.util.Scanner;
class test{
    public static boolean isGood(int n){
        int count = 1;
        while(n > 10){
            if(count%2==1){
                if((n%10) % 2 != 1){
                    return false;
                }
            }else{
                if((n%10) % 2 != 0){
                    return false;
                }
            }
            n = n /10;
            count++;
        }
        if(count % 2 == 1){
            if(n % 2 != 1){
                return false;
            }
        }else{
            if(n % 2 != 0){
                return false;
            }
        }

        return true;
    }

    public static void main(String[] args){
        Scanner scanner = new Scanner(System.in);
        int n = scanner.nextInt();
        int count = 0;
        for(int i = 1;i <= n;i++)
        {
            if(isGood(i)){
                count++;
            }
        }
        System.out.print(count);
    }
}